package com.weishe.weichar;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.lib.partition.HashPartitioner;

//按年分区，一个年一个区
public class WeatherPartitioner extends HashPartitioner<Weather, Text> {

	@Override
	public int getPartition(Weather key, Text value, int numReduceTasks) {
		// 计算要简单，
		return key.getYear() - 1949;
	}

}
